﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using TomatoSynchronizer.Store;

namespace TomatoSynchronizer.Entities 
{
    public class VariantGroup 
    {
    	public override bool Equals(object obj)
		{
			if(obj is VariantGroup)
			{
				VariantGroup group = (VariantGroup)obj;
				if(group._name == _name && group._rawvalue == _rawvalue && group._value == _value)
				{
					return true;
				}
			}
			
			return false;
		}

        public VariantGroup()
        {
        }

        private JObject __jobject;
        public VariantGroup(JObject obj)
        {
            this.__jobject = obj;
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }        

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private int _id;
        public int id
        {
            get
            {
                if(_id == null)
                    _id = JsonClassHelper.ReadInteger(JsonClassHelper.GetJToken<JValue>(__jobject, "id"));
                return _id;
            }
            set
            {
                _id = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _name;
        public string name
        {
            get
            {
                if(_name == null)
                    _name = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "name"));
                return _name;
            }
            set
            {
                _name = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _rawvalue;
        public string rawvalue
        {
            get
            {
                if(_rawvalue == null)
                    _rawvalue = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "rawvalue"));
                return _rawvalue;
            }
            set
            {
                _rawvalue = value;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private string _value;
        public string value
        {
            get
            {
                if(_value == null)
                    _value = JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "value"));
                return _value;
            }
            set
            {
                _value = value;
            }
        }

    }
}
